package com.mytrans.transaction;


import com.mytrans.beans.TranceRecordBean;
import com.mytrans.client.ListenerServletError;

import javax.servlet.http.HttpServlet;

public interface TransactionListener {
    /**
     * 需要执行的预扣款任务
     */
    <T> void commitListener(TranceRecordBean bean) throws Exception;

    /**
     * 执行的回滚任务
     */
    <T> void rollBackListener(TranceRecordBean bean) throws Exception;

    default HttpServlet getServlet(){
        return new ListenerServletError();
    }

}
